{% extends "polls/base.html" %}
{% block title %}<title>search</title>{% endblock %}
{% block body %}
<a href="{% url 'polls:css' %}">css page</a>
{# <a href="{% url 'polls:detail' poll.id %}">Vote?</a> #}
<a href="{% url 'polls:index' %}">Back to Index</a>
<a href="{% url 'polls:about' %}">About</a>
<a href="{% url 'polls:create' %}">Create polls</a>
<a href="{% url 'polls:search_form' %}">Search</a>
{% if errors %}
<ul>
  {% for error in errors %}
  <li>{{ error }}</li>
  {% endfor %}
</ul>
{% endif %}
<form action="{% url 'polls:search'  %}" method='POST'>{% csrf_token %}
  <input type="text" name='q'>
  <input type="submit" value="Search">
</form>
{% if polls %}
<h1>result: Found {{ polls|length }} poll{{ polls|pluralize }}.</h1>
<table>
  {% for poll in polls %}
  <tr><td><a href="{% url 'polls:detail' poll.id %}">{{ poll.question }}</a></td></tr>
  {% endfor %}
</table>
{% endif %}
{% endblock %}